package com.fjh.controller;

import com.fjh.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("p/sms/")
@Api(tags = "发送验证码的功能")
public class SendController {

    @Autowired
    private UserService userService;

    @PostMapping("send")
    @ApiOperation("发送短信验证码")
    public ResponseEntity<String> send(@RequestBody Map<String,String>map){
        userService.sendPhoneCode(map);
        return ResponseEntity.ok("发送验证码成功");
    }



}
